const fourBtn = ['red','blue','black','purple']
export default {
	namespace : 'game',
	state : {
		gameplay: {
			speed : [800,1200,1600]
		},
		speed : 800 ,
		gameOpt : createGameOpt(fourBtn) ,
		buttons : fourBtn
	},
	subscriptions:{

	},
	reducers: {
		speedOpt(state,{payload}){
			return {
				...state ,
				speed : payload
			}
		}
	},
	effects: {
		*clickChecke(state,{ payload }) {
			return {
				...state
			}
		}
	}
}

function createGameOpt(fourBtn){
	let game = {};
	function selectRandom(){
		return Math.floor(Math.random() * fourBtn.length);
	}
	for(let i = 0; i < 10 ; i++){
		let random = {};
		let oneCustoms = [];
		for(let j = (i+2); j > -1 ; j--){
			random[j] = selectRandom();
			oneCustoms[j] = fourBtn[random[j]];
		}

		game[i] = oneCustoms
	}
	return game;
}